package com.police.adapter;

import java.util.List;

import com.police.R;
import com.police.activity.BaseActivity.ShiJianBean;
import com.police.db.User;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

/**
 * �¼��б�������������Ա��
 * @author 
 *
 */
public class ShiJianListViewAdapter extends BaseAdapter{

	private Context mContext;
	private List<User> shiJianBeanList;
	public ShiJianListViewAdapter(Context mContext,List<User> shiJianBeanList) {
		this.mContext = mContext;
		this.shiJianBeanList = shiJianBeanList;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return shiJianBeanList.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		if (convertView == null) {
			LayoutInflater layoutInflater = ((Activity) mContext).getLayoutInflater();
			convertView = layoutInflater.inflate(R.layout.search_record_item, parent, false);
			convertView.setTag(convertView);
		} else {
			convertView = (View) convertView.getTag();
		}
		TextView name = (TextView)convertView.findViewById(R.id.name);
		name.setText(shiJianBeanList.get(position).name);
		TextView count = (TextView)convertView.findViewById(R.id.count);
//		count.setText(shiJianBeanList.get(position).getEventNum());
		return convertView;
	}

}
